<?php if (!defined('BASEPATH')) exit('No direct script access allowed');

class Proto extends CI_Controller 
{

   private $data;

   public function __construct() 
   {
      parent::__construct();

      $this->data = array();
   }

   public function index() 
   {
      $this->data['article'] = array('title' => 'CodeIngiter is really cool!');
      $this->data['users'] = $this->db->get('users');

      $this->load->model('Users');

      $this->data['model'] = $this->Users->getUserEmails();

      $this->load->view('proto_view', $this->data);
   }

   public function unit_test()
   {
      $this->load->library('unit_test');
      $this->unit->use_strict(TRUE);

      
      $test_var = 23;
      $this->unit->run($test_var, 10, 'Testing integer values');
      
      
      //
      // Test Users model
      //
      $this->load->model('Users');
      
      $name = 'Rodrigo';
      $res = $this->Users->getName($name);
      $this->unit->run($res, $name, "User::getName expected {$name}, got {$res}");

      
      //
      // Get test results
      //
      $this->load->library('unit-test/UnitTestReport');
      $this->data['report'] = $this->unittestreport->getSummary($this->unit->result());
      
      $this->load->view('unit-test/report-summary', $this->data);
   }
   
   public function scan()
   {
      $this->load->helper('url');
      $this->load->view('proto/scan');
   }

}

/* End of file proto.php */
/* Location: ./application/controllers/proto.php */